<div id="top">
    <h1 id="main-logo"><a href="./"><img height="40" src="<?= image_path("msa/msa_logo.png") ?>"></a></h1>
    <div id="labels">
        <ul>
            <?php
            $login_infos = Erra_Persistance_Session::get('login_infos');
            $infos = '';
            if (is_object($login_infos)) {
                $infos = $login_infos->nom . ' ' . $login_infos->prenom;
            }
            ?>
            <li>
                <a href="<?= Erra_System_PageBuilder::makeLink('edit-profile') ?>" class="user">
                    <span class="bar">Bienvenue <?= $infos ?></span>
                </a>
            </li>
            <li><a href="<?= Erra_System_PageBuilder::makeLink('disconnect-user') ?>" class="logout"></a></li>
        </ul>

    </div>
    <div class="contact-ibc"><?= Tools_ContactPopupObject::getObject(uniqid(), 'CREATE')->_editInPlace('AdminAction/sendContactMessage', 'Besoin d\'aide') ?></div>
    <div id="menu">
        <?php
        $current_calendar = (Erra_System_PageBuilder::getCurrentPageName(0) == 'calendar') ? ' class="current" ' : '';
        if (Access_ControlObject::get('is_admin') > 1) {
            $current_accueil = (Erra_System_PageBuilder::getCurrentPageName(0) == 'default') ? ' class="header-home" ' : '';
            $current_agenda = (Erra_System_PageBuilder::getCurrentPageName(0) == 'planning') ? ' class="header-agendas" ' : '';
            $current_location = (Erra_System_PageBuilder::getCurrentPageName(0) == 'location') ? ' class="header-lieux" ' : '';
            $current_prestations = (Erra_System_PageBuilder::getCurrentPageName(0) == 'prestations') ? ' class="header-prestations" ' : '';
            $current_acces = (Erra_System_PageBuilder::getCurrentPageName(0) == 'acces') ? ' class="header-acces" ' : '';
            $current_client = (Erra_System_PageBuilder::getCurrentPageName(0) == 'clients') ? ' class="header-clients" ' : '';
        }
        if (Access_ControlObject::get('is_admin') == 3) {
            $current_stats = (Erra_System_PageBuilder::getCurrentPageName(0) == 'stats') ? ' class="header-stats" ' : '';
            $current_mailsms = (strstr(Erra_System_PageBuilder::getCurrentPageName(0), 'mail-sms')) ? ' class="header-mailsms" ' : '';
            $current_config = (Erra_System_PageBuilder::getCurrentPageName(0) == 'configuration') ? ' class="header-configuration" ' : '';
        }
        ?> 
        <ul> 
            <? if (Access_ControlObject::get('is_admin') > 1) : ?>
                <li<?= $current_accueil ?>><a href="<?= Erra_System_PageBuilder::makeAjaxLink('default') ?>">Accueil</a></li> 
            <? endif; ?>
            <li<?= $current_calendar ?>><a href="<?= Erra_System_PageBuilder::makeAjaxLink('calendar') ?>"><strong>Agendas</strong></a></li>
            <? if (Access_ControlObject::get('is_admin') > 1) : ?>
                <li<?= $current_agenda ?>><a href="<?= Erra_System_PageBuilder::makeAjaxLink('planning') ?>">Gérer agendas</a></li> 
                <li<?= $current_location ?>><a href="<?= Erra_System_PageBuilder::makeAjaxLink('location') ?>">Lieux</a></li> 
                <li<?= $current_prestations ?>><a href="<?= Erra_System_PageBuilder::makeAjaxLink('prestations') ?>">Prestation</a></li>
                <li<?= $current_acces ?>><a href="<?= Erra_System_PageBuilder::makeAjaxLink('acces') ?>">Accès</a></li>
                <li<?= $current_client ?>><a href="<?= Erra_System_PageBuilder::makeAjaxLink('clients') ?>">Clients</a></li>
            <? endif; ?>

            <? if (Access_ControlObject::get('is_admin') == 3) : ?>
                <li<?= $current_stats ?>><a href="<?= Erra_System_PageBuilder::makeAjaxLink('stats') ?>">Stats</a></li>
                <li<?= $current_mailsms ?>><a href="<?= Erra_System_PageBuilder::makeAjaxLink('mail-sms') ?>">Mails / SMS</a></li>
                <li style="border-right:none;" <?= $current_config ?>><a style="border-right:none;" href="<?= Erra_System_PageBuilder::makeAjaxLink('configuration') ?>">Config</a></li>
            <? endif; ?>
        </ul>
    </div>
</div>
